#ifndef __PACKAGE_WRITER_H__
#define __PACKAGE_WRITER_H__

#include <cstdint>
#include "Utils/BinaryIO.h"
#include "Engine/Point2.hpp"
#include "Engine/Point3.hpp"
#include "Engine/Vector2.hpp"
#include "Engine/Vector3.hpp"
#include "Engine/Quaternion.h"
#include "Engine/Ray3.h"
#include "Engine/Matrix.h"
#include "Game/TerrainRaycastResult.hpp"
#include "Game/CellFace.h"
#include "Engine/Color4.hpp"
#include "Engine/GameGuid.h"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{
    class PackageWriter : public Utils::DynamicBinaryWriter
    {
    public:
        PackageWriter(uint32_t buffSize = 2048);
        void writePoint2(const Point2 &point);
        void writePoint3(const Point3 &point);
        void writeBlockPoint3(const Point3 &point);
        void writeVector2(const Vector2 &vector);
        void writeVector3(const Vector3 &vector);
        void writeQuaternion(const Quaternion &quaternion);
        void writeRay3(const Ray3 &ray3);
        void writeCellFace(const CellFace &cellFace);
        void writeColor4(const Color4 &color);
        void writeTerrainRaycastResult(const TerrainRaycastResult &terrainRaycastResult);
        void writeMatrix(const Matrix &matrix);
        
        void writeGuid(const GameGuid &gameGuid);
    };

    inline PackageWriter::PackageWriter(uint32_t buffSize) : DynamicBinaryWriter(buffSize) {}
    
} // namespace PocketSurvival

#endif
